package com.mxpio.webapp.entity;

import com.mxpioframework.jpa.annotation.Generator;
import com.mxpioframework.security.annotation.Dict;
import com.mxpioframework.security.entity.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.ToString;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 * 服务器表
 *
 * @author: Cheng
 * @date: 2022/10/29
 */
@Entity
@Table(name = "MI_MONITOR_SERVER")
@ToString
@Data
public class MonitorServer extends BaseEntity {

    @Id
    @Generator
    @Schema(description = "id")
    @Column(name = "id", length = 64)
    private String id;

    /**
     * IP地址
     */
    @Column(name = "IP", length = 15)
    @Schema(description = "IP地址")
    private String ip;

    /**
     * 服务器名
     */
    @Column(name = "SERVER_NAME", length = 30)
    @Schema(description = "服务器名")
    private String serverName;

    /**
     * 服务器摘要
     */
    @Column(name = "SERVER_SUMMARY", length = 128)
    @Schema(description = "服务器摘要")
    private String serverSummary;

    /**
     * 服务器状态（0：离线，1：在线）
     */
    @Column(name = "IS_ONLINE", length = 16)
    @Schema(description = "服务器状态")
    @Dict(dicCode = "MI_MONITOR_ONLINE")
    private String isOnline;

    /**
     * 离线次数
     */
    @Column(name = "OFFLINE_COUNT")
    @Schema(description = "离线次数")
    private Integer offlineCount;

    /**
     * 连接频率
     */
    @Column(name = "CONN_FREQUENCY")
    @Schema(description = "连接频率")
    private Integer connFrequency;

    /**
     * 监控环境
     */
    @Column(name = "MONITOR_ENV")
    @Schema(description = "监控环境")
    private String monitorEnv;

    /**
     * 监控分组
     */
    @Column(name = "MONITOR_GROUP")
    @Schema(description = "监控分组")
    @Dict(dicCode = "MI_MONITOR_GROUP")
    private String monitorGroup;

    /**
     * 机房位置
     */
    @Column(name = "SERVER_LOCATION")
    @Schema(description = "机房位置")
    private String serverLocation;

}
